/* 
 * File:   LPExtractorNL.h
 * Author: sergey
 *
 * Created on 13 Декабрь 2009 г., 16:45
 */

#ifndef _LPEXTRACTORNL_H
#define	_LPEXTRACTORNL_H

#include "LPLibrary.h"
#include "NLLibrary.h"
#include <queue>

template <typename LIBINFO>
class LPExtractorNL:public LPLibrary<LIBINFO> {
public:
    LPExtractorNL() { }
    ~LPExtractorNL() { }
    inline void putLPtoNL(const UInt64 f, const UInt8 s) {
        enum {
            lm = (UInt64)1 << (LIBINFO::aC - 1)
        };
        std::queue<UInt64> q;
        q.push(f);
        this->done[f] = true;
        while(!q.empty()) {
            UInt64 tf = q.front(); q.pop();
            if (tf < lm) nllib.set(tf, s);
            insertLPModify<LIBINFO, LIBINFO::n>::go(this->done, q, tf);
        }
    }
    NLLibrary<LIBINFO> nllib;
    
};

#endif	/* _LPEXTRACTORNL_H */

